<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f"%>
<%@ page import="java.util.List"%>
<%@ page isELIgnored="false" %> <%--isELIgnored=true禁用EL表达式--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>登录</title>
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/reset.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/main.css">
</head>
<div class="login_top clearfix">
	<a href="index.jsp" class="login_logo"></a>
</div>

<div class="login_form_bg">
	<div class="login_form_wrap clearfix">
		<div class="login_banner fl"></div>
		<div class="slogan fl">日夜兼程 · 急速送达</div>
		<div class="login_form fr">
			<div class="login_title clearfix">
				<h1>用户登录</h1>
				<a href="registerPage">立即注册</a>
			</div>
				<div class="form_input">
					<form action="", method="POST">
						<input type="text" name="uPhone" class="name_input" placeholder="请输入手机号" id="uPhone">
						<div class="user_error">输入错误</div>
						<input type="password" name="pwd" class="pass_input" placeholder="请输入密码" id = "uPass">
						<div class="pwd_error">输入错误</div>
						<div class="more_input clearfix">
							<input type="checkbox" name="">
							<label>记住用户名</label>
							<a href="#">忘记密码</a>
						</div>

					</form>

				</div>
				<div>
				    <button onclick="login()">登录</button>
				</div>
			</div>
		</div>
	</div>

	<div class="footer">
		<div class="foot_link">
			<a href="#">张旭光太胖</a>
			<span>|</span>
			<a href="#">张旭光太丑</a>
			<span>|</span>
			<a href="#">张旭光太虚</a>
			<span>|</span>
			<a href="#">健脑补肾丸</a>
		</div>
		<p> 北京旭光补肾技术有限公司 </p>
		<p>电话：541885418828    京ICP备*******8号</p>
	</div>

</body>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.min-2.1.1.js"></script>
<script>
    function login(){
        var uPhone = $("#uPhone").val();
        if(uPhone == null || uPhone ==''){
            alert("手机号不能为空！");
            return null;
        }
        var uPass = $("#uPass").val();
        if(uPass == null || uPass ==''){
            alert("密码不能为空！");
        }
        var params= "uPhone="+uPhone+"&uPass="+uPass;
        console.info(params);
        $.ajax({
            url:"login",
            data:params,
            type:"POST",
            success: function (str){
                if(str=="0"){
                    alert("登录失败！");
                }else{
                    alert("登陆成功！");
                    window.location.href="/shop/list";
                }
            }
        })
    }
</script>

</html>











